<?php


namespace App\Http\Requests\Platform;

use App\Http\Requests\BaseRequest;

class AdminMenuRequest extends BaseRequest
{
    public $scenes=[
        'add'=>['name','rule_id','pid'],
        'edit'=>['id','name','rule_id','pid'],
    ];

    public function rules()
    {
        return [
            'id' => 'required|integer',
            'name' => 'required',
            'rule_id' => 'required|integer',
            'pid' => 'required|integer',
        ];
    }

    public function messages()
    {
        return [
            'id.required' => 'id不能为空',
            'id.integer' => 'id必须为整数',
            'name.required' => '菜单名称不能为空',
            'name.between' => '菜单名称长度在2到8之间',
            'rule_id.required' => '权限id不能为空',
            'rule_id.integer' => '权限id必须为整数',
            'pid.required' => '父级权限id不能为空',
            'pid.integer' => '父级权限id必须为整数',
        ];
    }






}
